﻿using HandyControl.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace WpfDemo.Common
{
    public class MessageHelper
    {
        /// <summary>
        /// 成功提示
        /// </summary>
        /// <param name="msg"></param>
        public static void ShowSuccess(string msg="操作成功")
        {            
            Growl.Success(msg);
        }

        /// <summary>
        /// 失败提示
        /// </summary>
        /// <param name="msg"></param>
        public static void ShowError(string msg = "操作失败")
        {
            Growl.Error(msg);
        }


        /// <summary>
        /// 操作完成
        /// </summary>
        /// <param name="msg"></param>
        public static void ShowInfo(string msg = "操作完成")
        {
            Growl.Info(msg);
        }

        /// <summary>
        /// 警示 操作完成
        /// </summary>
        /// <param name="msg"></param>
        public static void ShowWarning(string msg = "操作完成")
        {
            Growl.Warning(msg);
        }

        /// <summary>
        /// 确认提示
        /// </summary>
        /// <param name="msg"></param>
        public static bool ShowConfirm(string msg = "确定要删除吗")
        {           
            return HandyControl.Controls.MessageBox.Show(msg, "提示", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes;
        }

        /// <summary>
        /// 确认提示
        /// </summary>
        /// <param name="msg"></param>
        public static void ShowAlert(string msg = "确定吗")
        {            
            HandyControl.Controls.MessageBox.Show(msg, "提示", MessageBoxButton.OK, MessageBoxImage.Information);
        }


    }
}
